//找到网页上画图的位置，并且用ECharts初始化
var myChart = echarts.init(document.getElementById("idx1"));
  //配置绘图参数
  var option = {
     title: {
          text: '网球拍销量-徐龙',
          left: 'center',
      },
      tooltip: {
          trigger: 'axis',
      },
     xAxis: {
         type: 'category',
         data: ['一','二','三','四','五'],
         name: '月份',
     },
     yAxis: {
         name: '销量',
     },
     legend: {
        top:'bottom',
     },
     series:[{
         type:'scatter',
         data:[160,170,140,140,130],
         name: '海德',
     },{
        type:'line',
        smooth: true,
        data:[120,140,130,100,80],
        name: '百宝力',
    },{
        type:'bar',
        data:[140,120,130,180,150],
        name: '威尔胜',
    }]
  };
  //画图
  myChart.setOption(option);

//--------------------------------------------------
var myChart2 = echarts.init(document.getElementById("idx2"));
//配置绘图参数
var option2 = {
    title: {
        text: '油量表参数设置——徐龙',
    },
    series:{
        type:'gauge',
        radius: "95%",
        data: [{
            name: '油量表',
            value: 120,
            title:{
                show:true,
                color:'red',
                backgroundColor:'yellow',
                fontSize:15
            },
            detail:{
              show:true,
              color:'black',
              fontSize:15,
              formatter:'{value} L'
            },
        }],
        axisLine: {
            lineStyle: {
                color: [
                  [0.3, 'red'], 
                  [0.6, 'green'], 
                  [1, 'blue'], 
                ],
            },
        },
        axisTick: {
        },
        axisLabel: {
            show: false,
        },
        min: 20,
        max: 200,
        
    }
};
//画图
myChart2.setOption(option2);

 //找到网页上画图的位置，并且用echarts初始化这个区域
 var myChart3 = echarts.init(document.getElementById("idx3"));
 //配置绘图参数
 var option3 = {
     title: {
         text: '马斯洛需求层次—徐龙',
     },
     series: [{
         type:'funnel',
         sort: 'ascending',
         data:[{
             value: 1,
             name: '1',
             itemStyle: {
                 color: 'black',
             },
         },2,3],
     }],
  };
 myChart3.setOption(option3);
 
 
 var myChart4 = echarts.init(document.getElementById("idx4"));
 var option4 = {
     title: {
         text: '雷达—徐龙',
     },
     legend: {
         left: 'right',
         orient: 'vertical',
     },
     visualMap: [{
         color:['yellow','green','blue'],
         min:59,
         max:100,
         calculable:true,
         orient: 'horizontal',
         left:'center'
     }],
     radar: {
         indicator: [{
             name: '语文',
             max: 100,
         },{
            name: '数学',
            max: 100,
        },{
            name: '英语',
            max: 100,
        }],
        shape: 'circle',
        splitNumber: 10,
        splitArea: {
            areaStyle: {
                color: ['red','white'],
            },
        },
     },
     series: [{
         type:'radar',
         data: [{
             value: [96,97,98],
             name: 'A',
         },{
            value: [66,74,71],
            name: 'B',
        },,{
            value: [66,64,61],
            name: 'C',
        }],
     }],
  };
 myChart4.setOption(option4);

 var myChart5 = echarts.init(document.getElementById("idx5"));
 //配置绘图参数
 var option5 = {
     //组件
     title: {
        text: '环形图-徐龙',
     },
     legend: {
         left: 'center',
         top: 'bottom',
     },
     tooltip: {
         formatter: '{b}:{c}({d}%)',
     },
     series:{
         type:'pie',
         radius: ['60%', '85%'],
         data:[{
             value: 2,
             name: '优',
            },{
            value: 2,
            name: '良',
            },{
            value: 5,
            name: '中',
            },{
            value: 1,
            name: '差',
         }], 
         label: {
             color: 'blue',
             position: 'inner',
         },
     },
    
 };
 //画图
 myChart5.setOption(option5);


var myChart6 = echarts.init(document.getElementById("idx6"));
//配置绘图参数
var option6 = {
    title:{
        text:'网球用品各品牌销量对比——徐龙',
        left: 'center',
    },
    grid: {
        left: '18%',
        right: '20%',
        bottom: '22%',
        top: '19%',
    },
    xAxis: {
        type: 'category',
        data: ["海德","百宝力","威尔胜","尤尼克斯"],
        name: '厂商',
    },
    yAxis: {
        name: '销量',
        min: 100,
        max: 2500,
    },
    legend: {
        bottom: 'bottom',
    },
    series: [{
        type:'bar',
        name: '网球拍',
        data: [600,600,500,300],
        label: {
            show: true,
            position: 'top',

        },
        stack: '总量',
    },{
        type:'bar',
        name: '网球',
        data: [900,800,1200,700],
        label: {
            show: true,
            position: 'top',
        },
        stack: '总量',
    },{
        type:'bar',
        name: '网球鞋',
        data: [500,600,500,400],
        label: {
            show: true,
            position: 'top',
        },
        stack: '总量',
    }],
};
myChart6.setOption(option6);